package com.ferryc.modules.sys.entity.param;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.ferryc.commons.entity.DataEntity;
import com.ferryc.constant.ValidatorConstant;
import com.ferryc.modules.sys.entity.SysDict;

/**
 * 
 * 类名: SysDict <br/>
 * 作用： <br/>
 * 方法： <br/>
 * 创建者: Ferry C <br/>
 * 添加时间: 2017年11月22日 09:14:51 <br/>
 * 
 */
public class SysDictParam extends DataEntity<SysDictParam> {
	private static final long serialVersionUID = 1L;
	/** TypeCode */
	@Length(min = 2, max = 40, message = ValidatorConstant.ERROR_DICT_TYPE_CODE)
	@Pattern(regexp = "[a-zA-Z0-9_]*", message = ValidatorConstant.ERROR_DICT_TYPE_CODE)
	private String typeCode;
	/** TypeName */
	@NotBlank(message = ValidatorConstant.ERROR_DICT_TYPE_NAME)
	@Length(min = 1, max = 40, message = ValidatorConstant.ERROR_DICT_TYPE_NAME)
	private String typeName;

	/** TypeValue */
	private String typeValue;

	/** 排序 */
	private Long sort;

	/** ParentId */
	@NotBlank(message = ValidatorConstant.NOT_EMPTY_DICT_PARENT_TYPE)
	private String parentId;

	public String getTypeCode() {
		return this.typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}

	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getTypeValue() {
		return this.typeValue;
	}

	public void setTypeValue(String typeValue) {
		this.typeValue = typeValue;
	}

	public Long getSort() {
		return this.sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	public String getParentId() {
		return this.parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public SysDict toSysDict() {
		SysDict po = new SysDict();
		po.setId(this.id);
		po.setTypeCode(this.typeCode);
		po.setTypeName(this.typeName);
		po.setTypeValue(this.typeValue);
		po.setSort(this.sort);
		po.setParentId(this.parentId);
		po.setStatus(this.status);
		po.setCreateBy(this.createBy);
		po.setCreateDate(this.createDate);
		po.setUpdateBy(this.updateBy);
		po.setUpdateDate(this.updateDate);
		po.setRemarks(this.remarks);
		po.setDelFlag(this.delFlag);
		po.setLimit(this.limit);
		po.setOffset(this.offset);
		po.setLikeName(this.likeName);
		return po;
	}

}